package cn.com.guage.guc.lock;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;

/**
 * @Author: LDeng
 * @Date: 2021-09-05 13:06
 */
public class ThreadDemo44 {

    public static void main(String[] args) {

       Map<String,String> map=new ConcurrentHashMap<>();
        for (int i = 0; i < 100; i++) {
            String key=String.valueOf(i);
            new Thread(()->{
                map.put(key,UUID.randomUUID().toString().substring(0,8));
                System.out.println(map);
            },String.valueOf(i)).start();
        }
    }



}
